From 7915e998e2459eee04f0fc52d018183d26c2a4d2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 13 May 2020 21:45:25 -0400 Subject: [PATCH] listbox: Make Shift-Tab work again The previous fix broke the case where we're Shift-Tabbing from a listboxrow child to the row itself. This was causing the widget-factory2.tab-backward test to fail. Fix it, by grabbing the focus to the row explicitly. --- gtk/gtklistbox.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index bc4676566f..11e64e95ae 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -2944,6 +2944,10 @@ gtk_list_box_row_focus (GtkWidget *widget, /* If exiting child container to the left, select row */ if (direction == GTK_DIR_LEFT || direction == GTK_DIR_TAB_BACKWARD) { + /* grab focus explicitly, since gtk_list_box_row_set_focus() + * refuses to steal it from a child + */ + gtk_widget_grab_focus (GTK_WIDGET (row)); gtk_list_box_row_set_focus (row); return TRUE; } -- 2.30.2